/*共通表存储过程*/
CREATE OR REPLACE FUNCTION count_common()
returns trigger as $$

declare
counts integer;

begin
   select count(*) into counts from common;
    return counts;
end;
$$
language plpgsql;

/*个人信息存储过程*/
CREATE OR REPLACE FUNCTION count_family()
returns trigger as $$

declare
counts integer;

begin
   select count(*) into counts from family;
    return counts;
end;
$$
language plpgsql;

/*事件表*/
CREATE OR REPLACE FUNCTION count_event()
returns trigger as $$

declare
counts integer;

begin
   select count(*) into counts from event;
    return counts;
end;
$$
language plpgsql;

/*关系表*/
CREATE OR REPLACE FUNCTION count_relation()
returns trigger as $$

declare
counts integer;

begin
   select count(*) into counts from relation;
    return counts;
end;
$$
language plpgsql;

/*家族*/
CREATE OR REPLACE FUNCTION count_people()
returns trigger as $$

declare
counts integer;

begin
   select count(*) into counts from people;
    return counts;
end;
$$
language plpgsql;